<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script>
$(function(){
	$("#boardListBtn").click(function(){
		if($("#word").val().length<2){
			alert("검색어는 두 글자 이상 입력해주세요");
			return false;
		}
		location.href="${initParam.root}collection/"+$("#findCollection").val()+"?word="+$("#word").val();
	});
});//ready
</script>
<b style="color: red;">'${param.word }'</b> (제목) 으로 <b>자소서첨삭</b> 대상 검색결과<br><br>
<table class="corr_list_table">
	<thead>
		<tr>
			<td width="10%">글번호</td>
			<td width="40%">제목</td>
			<td width="15%">작성자</td>
			<td width="15%">작성일</td>
			<td width="10%">조회수</td>
			<td width="10%">추천수</td>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="bvo" items="${requestScope.collectionListVO.list}">
			<tr>
				<td>${bvo.no}</td>
				<td>
					<!-- 답글인 경우 -->
					<c:if test="${bvo.relevel!=0}">
					<a	href="${initParam.root }collection/auth_replyWriteDetailNohit.do?no=${bvo.no }">
					<c:forEach begin="0" end="${bvo.relevel}" step="1"> &nbsp; </c:forEach>
					<img src="${initParam.root }img/reply.gif">
						${bvo.title}</a>
					</c:if>
					<!-- 일반 게시글인 경우 -->
					<c:if test="${bvo.relevel==0 }">
						<a	href="${initParam.root }collection/auth_detailCollectionHitPlus.do?no=${bvo.no }">${bvo.title}</a>
					</c:if>
				</td>
				<td>${bvo.memberVO.id }</td>
				<td>${bvo.date }</td>
				<td>${bvo.hit }</td>
				<td>${bvo.like }</td>
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="6" align="right"><a
				href="${initParam.root }/collection/auth_writeCollectionGo.do">글쓰기</a></td>
		</tr>
	</tfoot>
</table>
<center>
<p>
	<c:if
		test="${requestScope.collectionListVO.pagingBean.previousPageGroup}">
		<a
			href="${initParam.root }collection/contentList.do?nowPage=${requestScope.collectionListVO.pagingBean.
	 startPageOfPageGroup-1}">◀</a>
	</c:if>
	<c:forEach var="i"
		begin="${requestScope.collectionListVO.pagingBean.startPageOfPageGroup}"
		end="${requestScope.collectionListVO.pagingBean.endPageOfPageGroup}">
		<c:choose>
			<c:when test="${requestScope.collectionListVO.pagingBean.nowPage!=i}">
				<a href="${initParam.root }collection/contentList.do?nowPage=${i}">${i}</a>
			</c:when>
			<c:otherwise>
			<font style="color: red; font-size: 10.5pt;">${i}</font>
		</c:otherwise>
		</c:choose>
	</c:forEach>
	<c:if test="${requestScope.collectionListVO.pagingBean.nextPageGroup}">
		<a
			href="${initParam.root }collection/contentList.do?nowPage=${requestScope.collectionListVO.pagingBean.
	 endPageOfPageGroup+1}">▶
		</a>
	</c:if>
</p>
<select id="findCollection">
		<option value="findCollectionByTitle.do">제목</option>
		<option value="findCollectionByContent.do">내용</option>
		<option value="findCollectionByTitleAndContent.do">제목+내용</option>
	</select>
	<input type="search" id="word">
	<input type="button" id="boardListBtn" value="검색">
</center>